package moc.egg;
import moc.compiler.*;
import moc.tds.*;
import moc.type.*;
import moc.gc.*;
import java.util.*;
import moc.type.object.*;
import mg.egg.eggc.runtime.libjava.lex.*;
import mg.egg.eggc.runtime.libjava.*;
import mg.egg.eggc.runtime.libjava.messages.*;
import mg.egg.eggc.runtime.libjava.problem.IProblem;
import java.util.Vector;
public class S_TX_MOC {
LEX_MOC scanner;
  S_TX_MOC() {
    }
  S_TX_MOC(LEX_MOC scanner, boolean eval) {
    this.scanner = scanner;
    this.att_eval = eval;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  boolean att_inconstructor;
  String att_myclass;
  boolean att_gauche;
  boolean att_isAff;
  DTYPE att_stype;
  boolean att_eval;
  DTYPE att_htype;
  String att_code;
  IMachine att_machine;
  TDS att_tds;
  LEX_MOC att_scanner;
  private void regle49() throws Exception {

    //declaration
    //appel
if  (att_eval)      action_type_49();
  }
  private void regle48() throws Exception {

    //declaration
    S_OPMUL_MOC x_2 = new S_OPMUL_MOC(scanner,att_eval) ;
    S_F_MOC x_4 = new S_F_MOC(scanner,att_eval) ;
    S_TX_MOC x_6 = new S_TX_MOC(scanner,att_eval) ;
    //appel
if  (att_eval)      action_auto_inh_48(x_2, x_4, x_6);
    x_2.analyser() ;
if  (att_eval)      action_sens_48(x_2, x_4, x_6);
    x_4.analyser() ;
if  (att_eval)      action_htype_48(x_2, x_4, x_6);
    x_6.analyser() ;
if  (att_eval)      action_type_48(x_2, x_4, x_6);
  }
private void action_sens_48(S_OPMUL_MOC x_2, S_F_MOC x_4, S_TX_MOC x_6) throws Exception {
try {
// instructions
x_4.att_gauche=false;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#sens","TX -> OPMUL #sens F #htype TX1 #type ;"});
}
  }
private void action_htype_48(S_OPMUL_MOC x_2, S_F_MOC x_4, S_TX_MOC x_6) throws Exception {
try {
// instructions
x_6.att_htype=this.att_htype;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#htype","TX -> OPMUL #sens F #htype TX1 #type ;"});
}
  }
private void action_auto_inh_48(S_OPMUL_MOC x_2, S_F_MOC x_4, S_TX_MOC x_6) throws Exception {
try {
// instructions
x_4.att_tds=this.att_tds;
x_6.att_tds=this.att_tds;
x_4.att_myclass=this.att_myclass;
x_6.att_myclass=this.att_myclass;
x_4.att_inconstructor=this.att_inconstructor;
x_6.att_inconstructor=this.att_inconstructor;
x_6.att_gauche=this.att_gauche;
x_2.att_machine=this.att_machine;
x_4.att_machine=this.att_machine;
x_6.att_machine=this.att_machine;
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#auto_inh","TX -> OPMUL #sens F #htype TX1 #type ;"});
}
  }
private void action_type_48(S_OPMUL_MOC x_2, S_F_MOC x_4, S_TX_MOC x_6) throws Exception {
try {
// instructions
if ((this.att_htype.equals(x_4.att_type))){
if ((x_6.att_stype.equals(x_4.att_type)&&x_2.att_typesComp.contains(this.att_htype))){
this.att_isAff=false;
this.att_stype=x_4.att_type;
this.att_code=x_4.att_code+x_6.att_code+this.att_machine.genOperation(x_2.att_op);
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMOCMessages.id_Type_non_conformes, MOCMessages.Type_non_conformes,new Object[]{""+x_6.att_stype.toString(), ""+x_4.att_type.toString()});

}
}
else {
att_scanner._interrompre(IProblem.Semantic, att_scanner.getBeginLine(), IMOCMessages.id_Type_non_conformes, MOCMessages.Type_non_conformes,new Object[]{""+x_6.att_stype.toString(), ""+x_4.att_type.toString()});

}
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#type","TX -> OPMUL #sens F #htype TX1 #type ;"});
}
  }
private void action_type_49() throws Exception {
try {
// instructions
this.att_isAff=true;
this.att_stype=this.att_htype;
this.att_code="";
}catch(RuntimeException e) {       att_scanner._interrompre(IProblem.Internal,att_scanner.getBeginLine(),ICoreMessages.id_EGG_runtime_error, CoreMessages.EGG_runtime_error,new Object[] { "MOC", "#type","TX -> #type ;"});
}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MOC.token_mult : // 255
        regle48 () ;
      break ;
      case LEX_MOC.token_div : // 256
        regle48 () ;
      break ;
      case LEX_MOC.token_mod : // 257
        regle48 () ;
      break ;
      case LEX_MOC.token_et : // 258
        regle48 () ;
      break ;
      case LEX_MOC.token_plus : // 252
        regle49 () ;
      break ;
      case LEX_MOC.token_moins : // 253
        regle49 () ;
      break ;
      case LEX_MOC.token_ou : // 254
        regle49 () ;
      break ;
      case LEX_MOC.token_inf : // 246
        regle49 () ;
      break ;
      case LEX_MOC.token_sup : // 248
        regle49 () ;
      break ;
      case LEX_MOC.token_infeg : // 247
        regle49 () ;
      break ;
      case LEX_MOC.token_supeg : // 249
        regle49 () ;
      break ;
      case LEX_MOC.token_neg : // 251
        regle49 () ;
      break ;
      case LEX_MOC.token_eg : // 250
        regle49 () ;
      break ;
      case LEX_MOC.token_affect : // 235
        regle49 () ;
      break ;
      case LEX_MOC.token_virg : // 233
        regle49 () ;
      break ;
      case LEX_MOC.token_pv : // 234
        regle49 () ;
      break ;
      case LEX_MOC.token_parf : // 230
        regle49 () ;
      break ;
      case LEX_MOC.token_crf : // 265
        regle49 () ;
      break ;
      case LEX_MOC.token_ident : // 277
        regle49 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMOCMessages.id_MOC_unexpected_token,MOCMessages.MOC_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
  }
